/* Copyright 2017, 2018, 2019, 2020 Gabriel Czernikier
 *
 * This file is part of Côtehaus.
 * Côtehaus is free software: you can redistribute it and/or modify
 * it under the terms of one of the following:
 * 1. The same dual license as that of Côtehaus itself, of which individual licenses are
 * the MIT License and the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 2. The MIT License.
 * 3. The GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * Côtehaus is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * MIT License and the GNU General Public License for more details.
 * You should have received a copy of the MIT License and the GNU General Public License
 * along with Côtehaus.  If not, see <https://opensource.org/licenses/MIT> and <http://www.gnu.org/licenses/>.
 */

#ifndef __CH_FIELD_ID_H
#define __CH_FIELD_ID_H

#include <stdbool.h>
#include <stdlib.h>
#include "lgwseq.h"
#include "types.h"

struct field_id_st {
	struct type_id_st *class_idx;
	struct type_id_st *type_idx;
	struct str_id_st *name_idx;
	unsigned long long idx;
	struct list_head field_id_list;  // list of all fields, non-partitioned per class
};

struct field_id *add_field_id(struct type_id_st *class_idx, struct type_id_st *fieldtype_idx, struct str_id_st *name, struct class_def_st *cotehaus_class_def /*save an inverse relation for search purposes*/);
#endif
